package springcloud.service;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springcloud.entity.Result;

/**
 * @author 韩顺平
 * @version 1.0
 */
@SuppressWarnings("all")
@FeignClient(value = "seata-account-micro-service")
public interface AccountService {

    /**
     * 老师解读
     * 1. 远程调用方式是 post
     * 2. 远程调用的url 为 http://seata-account-micro-service/account/reduce
     * 3. seata-account-micro-service 是nacos注册中心服务名 【将要被远程调用的微服务模块名】
     * 4. openfeign是通过 接口方式 调用服务
     */
    /**
     * 扣减账户余额
     */
    @PostMapping("/account/reduce")
    public Result reduce(@RequestParam("userId") Long userId, @RequestParam("money") Integer money);
}